<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>">
		<!--[if lte IE 6]></base><![endif]-->
		
		<title>广东科学技术职业学院考生报到系统>>>>领导</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link href="css/newindex.css" rel="stylesheet" type="text/css" />
			
		<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->
		<script src="js/jquery-1.5.js" language="javascript">
</script>
		<script src="js/newpublic.js" language="javascript">
</script>

		<script language="javascript" type="text/javascript"
			src="js/jquery.flot.js">
			
</script>
			<script src="js/jquery-ui-1.8.5.custom.min.js" language="javascript">
</script>
		<!--                     下面是柱状图所要用到的两个文件         -->

		<script language="javascript" type="text/javascript"
			src="js/Bar-chart.js">
</script>

		<!-- 下面是饼图所要用到的两个文件 -->
		<script type="text/javascript" src="js/jquery.flot.pie.min.js">
</script>
		<script type="text/javascript" src="js/Pie-chart.js">
</script>



		<script language="javascript">
function s(s) {
	if(s == 1) {
		$('#t1').css('display','block');
		$('#t2').css('display','none');
	} else {
		$('#t1').css('display','none');
		$('#t2').css('display','block');
	}
	index = s;
	getData(index);
}		

var index,t;	//当前显示的div	
var registerBarchart = new BarChart();
var paymentBarchart = new BarChart();

$(function() {
	index = 1;
	$("#content").draggable({cancel:".contable"});
	update();
})

function update() {
	getData(index);
	t=setTimeout("update()", 15000);
}

function getData(index) {
	showProgressBar(true, index);
	switch(index) {
		case 1:
			$.post("json/CollegeRegisterPaymentAction!allCollegeRegisterInfo",
				function(data) {
				registerInfo = eval("(" + data.jsonAllCollegeRegisterInfo + ")");
				barRegisterData = eval("(" + data.barAllCollegeRegisterInfo + ")");
				fillRegisterInfo(registerInfo); //填充报道情况数据
				registerBarchart.buildBarsChart($("#placeholderForBars"), $("#lengendForBars"), barRegisterData);
			})
			break;
		case 2:
			$.post("json/CollegeRegisterPaymentAction!allCollegePaymentInfo",
				function(data) {
				paymentInfo = eval("(" + data.jsonAllCollegePaymentInfo + ")");
				barPaymentData = eval("(" + data.barAllCollegePaymentInfo + ")");
				fillPaymentInfo(paymentInfo);  //填充缴费情况数据
				paymentBarchart.buildBarsChart($("#placeholderForBars2"), $("#lengendForBars2"), barPaymentData);
			})
			break;
	}
	showProgressBar(false, index);
}

//填充报道情况数据
function fillRegisterInfo(data) {
	//徐了第一列外其余td删除
	$("tr#collegesList td:gt(0)").remove();
	$("tr#studentCount td:gt(0)").remove();
	$("tr#registeredCount td:gt(0)").remove();
	$("tr#registeredFemaleCount td:gt(0)").remove();
	$("tr#registeredMaleCount td:gt(0)").remove();
	
	for(var a in data) {
		var td = $("<td align='center'>" + data[a].collegeName + "</td>")
		$("#collegesList").append(td);
		
		var td = $("<td align='center'>" + data[a].studentCount + "</td>")
		$("#studentCount").append(td);
		
		var td = $("<td align='center'>" + data[a].registeredCount + "</td>")
		$("#registeredCount").append(td);
		
		var td = $("<td align='center'>" + data[a].registeredFemaleCount + "</td>")
		$("#registeredFemaleCount").append(td);
		
		var td = $("<td align='center'>" + data[a].registeredMaleCount + "</td>")
		$("#registeredMaleCount").append(td);
	}
}
//填充缴费情况数据
function fillPaymentInfo(data) {
	//徐了第一列外其余td删除
	$("tr#collegesName td:gt(0)").remove();
	$("tr#totalAmount td:gt(0)").remove();
	$("tr#realAmount td:gt(0)").remove();
	$("tr#paidAmount td:gt(0)").remove();
	$("tr#unPaidAmount td:gt(0)").remove();
	
	for(var a in data) {
		var td = $("<td align='center'>" + data[a].collegeName + "</td>")
		$("#collegesName").append(td);
		
		var td = $("<td align='center' style='display:none;'>" + format(data[a].totalAmount) + "</td>")
		$("#totalAmount").append(td);
		
		var td = $("<td align='center' style='color: #0C0;'>" + format(data[a].realAmount) + "</td>")
		$("#realAmount").append(td);
		
		var td = $("<td align='center' style='color: #F00;'>" + format(data[a].paidAmount) + "</td>")
		$("#paidAmount").append(td);
		
		var td = $("<td align='center'>" + format(data[a].unPaidAmount) + "</td>")
		$("#unPaidAmount").append(td);
	}
}

//显示进度圈，当isShow为false时不显示,true则显示
function showProgressBar(isShow, index) {
	if (isShow) {
		$("#progressBar" + index).show();
	} else {
		$("#progressBar" + index).hide();
	}
}

//把元化为万
function format(data) {
	data = data * 1.0 / 10000;
    return data.toFixed(2)
}

</script>

	</head>

	<body onload="fixPNGAll()">
		<div id="bg">
			<div id="bodydiv">
				<div id="bodytitle">
					领导页面
					<div
						style="float: right; margin-top: 0px; margin-right: 20px; font-size: 14px; _margin-top: -60px;">
						<a href="logoutAction" style="color: #F00;">退出</a>
					</div>
				</div>
				<div id="menudiv">
					<div class="menu">
						<div style="position: relative;">
							<a href="leaderAction"><img src="newimages/l3.png"
									width="48" height="48" border="0" />
								<div>
									学&nbsp;校
								</div> </a>
						</div>
					</div>
					<div class="menu">
						<div style="position: relative;">
							<a href="leaderCollegeAction"><img
									src="newimages/l1.png" width="46" height="47" border="0" />
								<div>
									学&nbsp;院
								</div> </a>
						</div>
					</div>
					<div class="menu">
						<div style="position: relative;">
							<a href="leaderProfessionAction"><img
									src="newimages/l2.png" width="48" height="48" border="0" />
								<div>
									专&nbsp;业
								</div> </a>
						</div>
					</div>
				</div>
				<div id="content">
					<!--当前位置CSS-->
					<div class="top">
						<div class="topleft">
							<div class="dan">
								<div>
									当前位置>领导页面>学院概况
								</div>
							</div>
							<div class="F5">
								<img src="newimages/F5.png" />
							</div>
						</div>
						<div class="topright">
							<div class="toprightmin"></div>
							<div class="toprightmax"></div>
							<div class="toprightclose" onclick="if(confirm('是否确定退出！')){location.replace('loginoutAction')}" title="点击退出"></div>
						</div>
					</div>
					<!---->
					<!--内容-->
					<div class="condiv">
						<div class="submenu">
							<ul>
								<li>
									<a href="javascript:s(1)">报到情况</a>
								</li>
								<li>
									<a href="javascript:s(2)">缴费情况</a>
								</li>
							</ul>
						</div>
						<div class="contable">
							<!--******************************-->
							<div id="t1" style="display: block;">
								<div class="title">
									报到情况
								</div>

								<table width="90%" border="0" align="center" cellpadding="0"
									cellspacing="5" style="margin-top: 10px;" id="info">
									<tr id="collegesList">
										<td align="center">
											&nbsp;
										</td>
										<td align="center">
											计算机学院
										</td>
										<td align="center">
											经管学院
										</td>
										<td align="center">
											人文学院
										</td>
										<td align="center">
											外国语学院
										</td>
										<td align="center">
											建工学院
										</td>
										<td align="center">
											机电学院
										</td>
										<td align="center">
											广州学院
										</td>
										<td align="center">
											体教部
										</td>
									</tr>
									<tr id="studentCount">
										<td align="right">
											总人数：
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
									</tr>
									<tr id="registeredCount">
										<td align="right">
											已报到人数：
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
									</tr>
									<tr id="registeredMaleCount">
										<td align="right">
											男生总数：
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
									</tr>
									<tr id="registeredFemaleCount">
										<td align="right">
											女生总数：
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
									</tr>

									<tr name="a">
										<td height="75" colspan="9" align="center"
											style="border-top: 1px red dotted; font-size: 18px; color: red;">
											各学院实时报到率
										</td>
									</tr>
									
									<tr name="a">
										<td colspan="9" align="center">
											<div id="progressBar1" style="display: none">
													<!-- 进度圈 -->
													<center>
														<img src="images/loading.gif" />
													</center>
												</div>
											<div style="width: 90%">
												<div id="placeholderForBars"
													style="width: 600px; height: 300px; float: left;"></div>
												<div id="lengendForBars" style="float: right; width: 150px"></div>
											</div>
										</td>
									</tr>
								</table>
							</div>
						
							<div id="t2" style="display: none;">
								<div class="title">
									缴费情况   <font size="2">单位:万元</font>
								</div>
								<table width="90%" border="0" align="center" cellpadding="0"
									cellspacing="5" style="margin-top: 10px;">
									<tr id="collegesName">
										<td align="right">
											&nbsp;
										</td>
										<td align="center">
											计算机学院
										</td>
										<td align="center">
											经管学院
										</td>
										<td align="center">
											人文学院
										</td>
										<td align="center">
											外国语学院
										</td>
										<td align="center">
											建工学院
										</td>
										<td align="center">
											机电学院
										</td>
										<td align="center">
											广州学院
										</td>
										<td align="center">
											体教部
										</td>
									</tr>
									<tr id="totalAmount">
										<td align="right" style="display:none;">
											总缴费金额：
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
									</tr>
									<tr id="realAmount">
										<td align="right">
											应收缴费总额：
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
									</tr>
									<tr id="paidAmount">
										<td align="right">
											已缴费金额：
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
									</tr>
									<tr id="unPaidAmount">
										<td align="right">
											欠费金额：
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
										<td align="center">
										</td>
									</tr>
									<tr>
										<td height="75" colspan="9" align="center"
											style="border-top: 1px red dotted; font-size: 18px; color: red;">
											各学院实时缴费率
										</td>
									</tr>
									
									<tr>
										<td colspan="9" align="center" height=350>
											<div id="progressBar2" style="display: none">
													<!-- 进度圈 -->
													<center>
														<img src="images/loading.gif" />
													</center>
												</div>
											<div style="width: 90%">
												<div align="center" >已缴费率≈ ( <font style="color: #F00;">已缴费金额</font> / <font style="color: #0C0;">应收缴费总额</font> ) * 100%<br /></div>
												<div id="placeholderForBars2"
													style="width: 600px; height: 300px; float: left;"></div>
												<div id="lengendForBars2" style="float: right; width: 150px"></div>
											</div>
										</td>
									</tr>
								</table>
								
							</div>
					
						</div>
					</div>
					<!---->
					<!---->
					<div class="condiv"
						style="width: 997px; position: relative; height: 20px; min-height: 20px; text-align: center;">
						<a href="computer/computer.html" target="_blank">计算机学院程序员之家</a>
					</div>
					<!---->

					<!--低部-->
					<div class="bottom">
						&nbsp;
					</div>
					<!---->
				</div>
			</div>
		</div>
	</body>
</html>
